Skip to content

fix: downmerge from main to dev - #325

Merged
Avijit-Microsoft merged 20 commits into
devfrom
main
Jul 20, 2026
Merged

fix: downmerge from main to dev#325
Avijit-Microsoft merged 20 commits into
devfrom
main

Conversation

@VishalSh-Microsoft

Copy link
Copy Markdown
Contributor

Purpose

This pull request updates the deployment process and infrastructure configuration for container images, with a focus on improving clarity, security, and automation. The main changes are: container images are no longer built and pushed automatically during deployment; instead, clear instructions and scripts are provided for manual execution. Infrastructure defaults and documentation are updated to reflect these changes, and private networking for the Azure Container Registry (ACR) is enhanced.

Deployment process and documentation:

  • Updated deployment scripts (azure.yaml) so container images are not built/pushed automatically; users are now instructed to run acr_build_push.sh or acr_build_push.ps1 manually, and deployment logs reflect this change. [1] [2]
  • Improved deployment guide (docs/DeploymentGuide.md) to add a new step for manually building and pushing images after deployment, with clear instructions for both PowerShell and Bash. Step references in later instructions are updated accordingly. [1] [2]

Infrastructure configuration and security:

  • Changed the default image tag from "latest_v2" to "latest" and updated the placeholder container image to use the Azure Container Apps hello-world image, reflecting the new script-based deployment flow. [1] [2]
  • Enhanced ACR private networking: in WAF/private-networking mode, public network access is disabled at rest and only temporarily enabled for remote builds; private DNS zone and subnet resource IDs are now conditionally set for private deployments.
  • Added privatelink.azurecr.io to the list of managed private DNS zones and updated DNS zone index variables accordingly, improving private endpoint support for ACR. [1] [2] [3] [4]

Other improvements:

  • Updated the containerRegistryEndpoint parameter to be empty by default and marked as deprecated, clarifying that each deployment now provisions its own dedicated ACR.
  • Minor corrections to code ownership assignments in .github/CODEOWNERS.

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

Akhileswara-Microsoft and others added 17 commits July 7, 2026 15:29
- ps1: move WAF ACR relaxation inside try{} so finally{} always restores
  the locked-down state after any partial change
- ps1: check each restore command's exit code and warn per-step
- containerRegistry.bicep: update publicNetworkAccess description to reflect
  WAF-disabled-at-rest behavior with script-driven temporary enablement

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
chore: Update Owners ID for Vinay and Prajwal
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR downmerges changes that shift image build/push out of the default azd up flow and into explicit post-deployment scripts, while updating infrastructure defaults to provision a dedicated ACR per deployment and improving private-networking (WAF) behavior for ACR.

Changes:

  • Stop automatically building/pushing container images during azd deployment; guide users to run acr_build_push.* manually.
  • Update infra defaults (image tag, placeholder image, dedicated ACR + ACR private endpoint/DNS support in WAF mode).
  • Refresh deployment documentation and CODEOWNERS accordingly.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
scripts/acr_build_push.sh Adds subscription pinning + WAF ACR “open/close” behavior; updates logging/tag defaults.
scripts/acr_build_push.ps1 Mirrors bash script improvements for Windows, including WAF-safe ACR toggling.
infra/modules/containerRegistry.bicep Adds conditional ACR private endpoint + DNS zone group and WAF-aligned registry policies.
infra/main.bicep Updates image defaults and wires private endpoint/DNS inputs into the container registry module.
infra/main.json Generated ARM reflecting dedicated ACR provisioning, placeholder images, and private DNS zone additions.
docs/DeploymentGuide.md Adds a new step to manually build/push images after deployment and updates step references.
azure.yaml Removes automatic image build hook and replaces it with user-facing instructions.
.github/CODEOWNERS Updates default owner handles.
Comments suppressed due to low confidence (4)

scripts/acr_build_push.sh:99

  • If AZURE_SUBSCRIPTION_ID cannot be resolved (e.g., user runs the script without azd and without that env var), the script silently falls back to whatever Azure CLI subscription is currently active. Since the script explicitly calls out the risk of targeting the wrong subscription, it should warn when it can’t pin the subscription.
    scripts/acr_build_push.sh:69
  • The early "missing required deployment values" validation only checks ACR name and resource group. If the container app names are missing (and azd isn’t available to backfill them), the script will still do the remote builds and only fail later during update_app, wasting time/cost. Validate the required app-name outputs up-front so the script fails fast before building images.
    scripts/acr_build_push.ps1:99
  • If AZURE_SUBSCRIPTION_ID can’t be resolved (e.g., script run outside azd), the script silently proceeds using the Azure CLI’s current subscription. Given the risk called out in the comment above, emit a warning when the subscription can’t be pinned so users don’t accidentally build/update resources in the wrong subscription.
    scripts/acr_build_push.ps1:169
  • If container app names are missing, the script will still run the (potentially slow/costly) remote builds and only fail later inside Update-App. Fail fast before building images by validating the required container app name outputs right before the build step.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings July 17, 2026 12:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (2)

scripts/acr_build_push.sh:66

  • The script treats AZURE_SUBSCRIPTION_ID as “required” for the azd fallback (and later relies on it to pin the Azure CLI subscription / correctly detect WAF), but the final required-values validation only checks ACR name + resource group. If AZURE_SUBSCRIPTION_ID is missing (e.g., running outside azd hooks), the script will proceed using whatever Azure CLI subscription is currently active, which defeats the intent and can target the wrong subscription or fail to detect WAF mode.
    scripts/acr_build_push.ps1:97
  • AZURE_SUBSCRIPTION_ID is treated as optional here (the subscription is only set when it’s non-empty), but the script’s behavior depends on being scoped to the correct subscription (ACR updates, RG tag lookup for WAF detection, builds/updates). If the env var is missing, the script will run against whatever Azure CLI subscription is currently active, which can build/update the wrong deployment.

Comment thread infra/main.bicep
Comment thread infra/main.json
…ent-changes

fix: remove local deployment changes
Copilot AI review requested due to automatic review settings July 20, 2026 06:51
@Avijit-Microsoft
Avijit-Microsoft merged commit c892e62 into dev Jul 20, 2026
7 of 8 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (2)

scripts/acr_build_push.sh:64

  • AZURE_SUBSCRIPTION_ID is treated as required (and used to pin the Azure CLI subscription), but it is never included in the missing-value validation. If azd is unavailable (or doesn’t provide it), the script can proceed without pinning the subscription, which can cause az acr build / az containerapp update to run against the wrong subscription or fail later with less-clear errors. Validate AZURE_SUBSCRIPTION_ID alongside the other required deployment values (or make it consistently optional).
    scripts/acr_build_push.ps1:38
  • This block treats $SubscriptionId as one of the “required values” that triggers azd env get-values, but the script never errors if it remains unset and only pins the subscription when it’s non-empty. Either validate $SubscriptionId as truly required, or remove it from this condition so it’s consistently optional.

Comment thread infra/main.json
Comment on lines +877 to +878
"privateEndpointSubnetResourceId": "[if(parameters('enablePrivateNetworking'), createObject('value', resourceId(resourceGroup().name, 'Microsoft.Network/virtualNetworks/subnets', format('vnet-{0}', variables('solutionSuffix')), 'backend')), createObject('value', ''))]",
"privateDnsZoneResourceId": "[if(parameters('enablePrivateNetworking'), createObject('value', resourceId(resourceGroup().name, 'Microsoft.Network/privateDnsZones', 'privatelink.azurecr.io')), createObject('value', ''))]",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants